package com.gao.flying.example;

import com.gao.flying.mq.JmsClient;
import com.gao.flying.mq.annotation.Consumer;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import java.time.LocalDateTime;

@Consumer(destinationName="test1")
public class DemoConsumer implements MessageListener{
	

	@Override
	public void onMessage(Message message) {
		TextMessage msg = (TextMessage) message;
		try {
			LocalDateTime date = LocalDateTime.parse(msg.getText());
		} catch (JMSException e) {
			e.printStackTrace();
			throw new RuntimeException("");
		}
	}

	public static void main(String[] args) {
		JmsClient.startConsumer();
	}
}
